import { useEffect, useRef } from 'react';

const useTest = () => {
  const testRef = useRef<string | null>(null);

  useEffect(() => {
    setTimeout(() => {
      testRef.current = 'test';
    }, 1000);
  }, []);

  useEffect(() => {
    console.log('testRef', testRef);
    // testRef {current: null}
  }, [testRef]);

  useEffect(() => {
    console.log('testRef.current', testRef);
    // testRef.current {current: null}
    // testRef.current {current: 'test'}
  }, [testRef.current]);
};

export default useTest;
